﻿using System;
using System.Threading;

namespace Chapter1.Recipe1
{
	class Program
	{
		static void Main(string[] args)
		{
			Thread t = new Thread(PrintNumbers);
			t.Start();
			PrintNumbers();
            Console.ReadKey();
		}

		static void PrintNumbers()
		{
            Console.WriteLine("Starting PrintNumbers..."+System.Threading.Thread.CurrentThread.ManagedThreadId);
			for (int i = 1; i < 18; i++)
			{
                Thread.Sleep(TimeSpan.FromSeconds(2));
				Console.WriteLine(i+":"+Thread.CurrentThread.ManagedThreadId);
			}
		}
	}
}
